# $Id: PKGBUILD 160911 2012-06-06 19:20:20Z foutrelis $
# Maintainer:
# Contributor: Firmicus <francois.archlinux.org>
# Contributor: Tom K <tomk@runbox.com>

pkgname=mod_perl
pkgver=2.0.7
pkgrel=1
pkgdesc="Apache module that embeds the Perl interpreter within the server"
arch=('i686' 'x86_64')
url="http://perl.apache.org/"
license=('APACHE')
depends=('perl' 'apache' 'db' 'apr-util' 'perl-linux-pid')
options=('!emptydirs')
source=(http://perl.apache.org/dist/$pkgname-$pkgver.tar.gz
        mod_perl-2.0.6-nolfs.patch)
sha256sums=('53414be9db843054b927f23a35edb7b82d99e32e031b3cd81d5ff2473f51e3c6'
            '5d1b6a051d847108b23b5dc06ea5885c37dd81d3a9156b69d179d95b5cf92f08')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  # Patch from openSUSE to fix segfaults on i686 (FS#25008):
  #   avoid a conflict between apache's LARGEFILE64_SOURCE and perl's
  #   FILE_OFFSET_BITS=64 because the conflict isn't real and causes the perl
  #   structures to be invalid if only the apache flags are used
  patch -Np1 -i "$srcdir/mod_perl-2.0.6-nolfs.patch"

  # install module in vendor directories.
  perl Makefile.PL INSTALLDIRS=vendor MP_APXS=/usr/sbin/apxs
  make
}

package() {
  cd  "$srcdir/$pkgname-$pkgver"
  make install DESTDIR="$pkgdir"
}

# vim:set ts=2 sw=2 et:
